﻿using MediatR;
using T.Personnel.Domain.Dto;
using T.Personnel.Domain;
using T.Personnel.Read.API.Application.Command.EntryManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.EntryManageHandler
{
    public class GetListEntrysManageHandler : IRequestHandler<GetListEntrysManageCommand, Result<Manage>>
    {
        private readonly IManageRepository manageRepository;

        public GetListEntrysManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<Result<Manage>> Handle(GetListEntrysManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.GetEntrysAsync(request.Name, request.DepartmentId, request.PositionId, request.Hiredate, request.CreatedDate, request.AppStatus, request.PageIndex, request.PageSize, request.Stat);
        }
    }
}
